package com.wt.admin.service.file;

import com.aizuda.easy.security.exp.impl.BasicException;
import com.wt.admin.controller.FileController;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.multipart.MultipartFile;

import java.io.*;
import java.util.List;


public interface FileService {

    void init();

    String uploadLocal(MultipartFile file,String path, HttpServletRequest httpServletRequest) throws IOException;
    String uploadStrategy(MultipartFile file,String path, HttpServletRequest httpServletRequest) throws IOException, BasicException;

    List<String> uploadLocalBatch(MultipartFile[] file, String path, HttpServletRequest httpServletRequest);
    List<String> uploadStrategyBatch(MultipartFile[] file, String path, HttpServletRequest httpServletRequest);

    String finalDir = "D:\\download\\tmp\\uploads\\final";

    int serverPort = 8080;

    void saveChunk(MultipartFile file, String fileHash, String fileName, int chunkIndex, int totalChunks);
    List<Integer> getExistingChunks(String fileHash);
    String mergeChunks(FileController.MergeRequest request);
}
